package com.wx.chapter10.codeblock_;

import java.sql.SQLOutput;

/**
 * ClassName:CodeBlockDetail02
 * Package :com.wx.chapter10.codeblock_
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/6/3 - 18:03
 */
public class CodeBlockDetail02 {
    public static void main(String[] args) {
        A a = new A();
    }
}

class A {
    {
        //普通代码块
        System.out.println("ThreadPoolExecutor  普通代码块 01");
    }

    private int n2 = getN2();//普通属性的初始化

    static {//非静态代码块
        System.out.println("A静态代码块");
    }

    //静态属性初始化
    private static int N1 = getN1();

    public static int getN1() {
        System.out.println("getN1 被调用...");
        return 100;
    }

    public int getN2() { //普通方法/非静态方法
        System.out.println("getN2 被调用...");
        return 200;
    }

    //无参构造器
    public A() {
        System.out.println("ThreadPoolExecutor()  构造器被调用");
    }
}